import socket

HOST = "172.30.173.156"
PORT = 8000
print("Socket 通信服务启动~")
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.bind((HOST, PORT))
    s.listen(1)
    conn, addr = s.accept()
    with conn:
        print(f"Connect from {addr}")
        while True:
            data = conn.recv(1024)
            if not data:
                break
            print(f"server recived: {data}")
            conn.sendall(data)
